package com.atguigu.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.atguigu.base.BaseController;
import com.atguigu.entity.Dict;
import com.atguigu.result.Result;
import com.atguigu.service.DictService;
import com.atguigu.service.HouseService;
import com.atguigu.vo.HouseQueryVo;
import org.springframework.web.bind.annotation.*;

import java.util.List;
@RestController
@RequestMapping("/dict")
@CrossOrigin
@SuppressWarnings({"unchecked","rawtype"})
public class DictController {
      //没有继承baseController  因为查询条件已经分装在了 houseQueryVo
    @Reference
    private DictService  dictService;

    @RequestMapping("/findListByDictCode/{dictCode}")
    public Result findListByDictCode(@PathVariable String dictCode){
        //获取指定的字典项列表
        List<Dict> areaList123 = this.dictService.findListByDictCode(dictCode);
        return Result.ok(areaList123);
    }
    @RequestMapping("/findListByParentId/{parentId}")
    public Result findListByParentId(@PathVariable Long parentId){
        List<Dict> plateList = this.dictService.findListByParentId(parentId);
        return Result.ok(plateList);
    }

}
